/*
 * @Descripttion: 
 * @version: 
 * @Author: Ansel
 * @Date: 2020-05-15 15:40:42
 * @LastEditors: Ansel
 * @LastEditTime: 2020-05-15 15:58:12
 */ 

// Object.prototype.toString.call(null); // "[object Null]"
// Object.prototype.toString.call(undefined); // "[object Undefined]"
// Object.prototype.toString.call(“abc”);// "[object String]"
// Object.prototype.toString.call(123);// "[object Number]"
// Object.prototype.toString.call(true);// "[object Boolean]"
// Object.prototype.toString.call(fn); // "[object Function]"
// Object.prototype.toString.call(date); // "[object Date]"
// Object.prototype.toString.call(arr); // "[object Array]"
// Object.prototype.toString.call(reg); // "[object RegExp]"
function getType(val){
    return Object.prototype.toString.call(val).replace("[object ","").replace("]","").toUpperCase();
}

console.log(getType(null))